#include<stdio.h>
#include<conio.h>
#include<math.h>
struct phanso
{
       int one,two;
};
void nhap(phanso &s)
{
     printf("\n nhap so thu nhat");
     scanf("%d",&s.one);
     printf("\n nhap so thu hai");
     scanf("%d",&s.two);
}
void xuat(phanso s)
{
     printf("\n phan so vua nhap la:");
     printf("%d,%d",s.one,s.two);
} 
int ucln(int x,int y)
{
  if(y==0)return x; 
  else return ucln(y,x%y);  
}

phanso tong(phanso a,phanso b)
{
	phanso kq;
	kq.one=a.one+b.two;
	kq.two=a.one+b.two;
	return kq;
}
phanso hieu(phanso a,phanso b)
{ 
	phanso kq;
	kq.one=a.one-b.two;
    kq.two=a.one-b.two;
    return kq;
}
phanso tich(phanso a,phanso b)
{ 
	phanso kq;
	kq.one=a.one*b.two;
   	kq.two=a.one*b.two;
    return kq;
}
phanso thuong(phanso a,phanso b)
{ 
	phanso kq;
	kq.one=a.one/b.two;
    kq.two=a.one/b.two;
    return kq;
}

int main()
{
 phanso x;
 phanso y;
 nhap(x);
 xuat(x);
 nhap(y);
 xuat(y);
 
 printf("\n tong 2 pso la %d/%d",tong(x,y).one,tong(x,y).two);
 printf("\n hieu 2 pso la %d/%d",hieu(x,y).one,hieu(x,y).two);
 printf("\n tich 2 pso la %d/%d",tich(x,y).one,tich(x,y).two);
 printf("\n thuong 2 pso la %d/%d",thuong(x,y).one,thuong(x,y).two);
 
    getch();
}
